<!doctype html>
<html lang="zh">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>{{config "String" "title" "LeeChan'Blog"}} - 后台管理登录</title>
	<link rel="stylesheet" type="text/css" href="/static/css/styles.css">
</head>
<body>
<div class="htmleaf-container">
	<div class="wrapper">
		<div class="container">
			<h1>Welcome</h1>
			
			<form id="form" class="form">
				<input type="text" name="username" placeholder="Username">
				<input type="password" name="password" placeholder="Password">
				<button type="submit" id="login-button">Login</button>
			</form>
		</div>
		
		<ul class="bg-bubbles">
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
		</ul>
	</div>
</div>

<script src="/static/js/jquery-2.2.0.min.js" type="text/javascript"></script>
<script>
$('#login-button').click(function (event) {
	event.preventDefault();
	$('form').fadeOut(500);
	$('.wrapper').addClass('form-success');
	$.ajax({
		url:'/admin/login',
		type:'post',
		data:$("#form").serialize(),
		success:function (data) {
			console.log(data);
			if (data.code == 200) {
				window.location = "/admin"
			}else{
				$('form').fadeIn(500)
				$('.wrapper').removeClass('form-success');
			}
		}
	});
});
</script>

</body>
</html>